package gui;

import javax.swing.tree.DefaultMutableTreeNode;

public class UISupport {
	public static DefaultMutableTreeNode processHierarchyTreeNode(
			Object[] hierarchy) {
		DefaultMutableTreeNode node = new DefaultMutableTreeNode("root");
		DefaultMutableTreeNode child;
		for (int i = 0; i < hierarchy.length; i++) {
			Object nodeSpecifier = hierarchy[i];
			if (nodeSpecifier instanceof Object[]) { // Ie node with children
				child = processHierarchyTreeNode((Object[]) nodeSpecifier);
			} else {
				child = new DefaultMutableTreeNode(nodeSpecifier); // Ie Leaf
				// child.add(DBMS.mockNode);
			}

			node.add(child);
		}
		return (node);
	}
}
